VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsUpdateIndex"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public Function UpdateIndex(ByRef strUpdateIndex As String) As Boolean

Dim adoConn As ADODB.Connection
Dim adoComm As ADODB.Command


Dim SQL As String
Dim lrecordsaffected As Integer

On Error GoTo PROC_ERROR

Set adoConn = New ADODB.Connection
With adoConn
    .CursorLocation = adUseClient
    .ConnectionString = GetConnectionString() 'Johann (20090625): Centralised code for connection string added
    .Open
End With

Set adoComm = New ADODB.Command
With adoComm
    .CommandText = "Update dir_interface_index set req_seq_num = " & nReqSeqNum & ",sars_response_yn = 'N' where interface_no = " & IntegrationID
    .CommandType = adCmdText
    Set .ActiveConnection = adoConn
End With
    
adoComm.Execute lrecordsaffected

If lrecordsaffected > 0 Then
    strUpdateIndex = "Index table successfully updated with request sequence number " & nReqSeqNum
    UpdateIndex = True
Else
    UpdateIndex = False
End If

'clean up
Set adoComm = Nothing

adoConn.Close
Set adoConn = Nothing

PROC_EXIT:
  Exit Function

PROC_ERROR:
   Err.Raise Err.Number, _
            "clsUpdateIndex/UpdateIndex", _
            Err.Description
  Resume PROC_EXIT

End Function
